<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'My Web Application',
    'language' => 'zh_cn',
	'preload'=>array('log'),  // 预加载日志组件 'log' component

	// 自动加载 model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
        'application.extensions.*',
        'application.utils.*',
        'application.modules.user.UserModule',
        'application.modules.user.models.*',
        'application.modules.admin.UserModule',
        'application.modules.admin.models.*',
        'application.modules.mobile.UserModule',
        'application.modules.mobile.models.*',
        'application.extensions.PHPExcel.*',
	),

	'modules'=>array(
	    //脚手架模块
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'123456',
			'ipFilters'=>array('127.0.0.1','::1','localhost'),
		),
        'mobile' => array(
            'class'=>'application.modules.mobile.MobileModule',
        ),
        'admin' => array(
            'class'=>'application.modules.admin.AdminModule',
        )
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
        'cache' => array(
            'class'=>'system.caching.CFileCache',
        ),
        'coreMessages'=>array(
            'basePath'=>'protected/messages',
        ),
        /*'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),*/
        'controllerMap'=>array(
            'ueditor'=>array(
                'class'=>'ext.ueditor.UeditorController',
            ),
        ),
		/*'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
            'tablePrefix'=>'tbl_',
		),*/

		'db'=>array(
			'connectionString' => 'mysql:host=127.0.0.1;dbname=zhwl_temp',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '123456',
			'charset' => 'utf8',
		    'tablePrefix' => 'tbl_',
		),

		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>require_once 'params.php',
    //主题
    //'theme'=>'classic',
);